package app

import (
	"testing"

	"gitverse.ru/nickolasfox/kek/pkg/plugins/fake"
	"gitverse.ru/nickolasfox/kek/pkg/tools"
)

func NewTestCommands(t testing.TB) *Commands {
	app := NewCommands(fake.NewComplete())
	return app
}

func TestCommandsExecute(t *testing.T) {
	t.Run("ok", func(sub *testing.T) {
		app := NewTestCommands(sub)
		tools.WithArgs(sub, []string{"kek", "this", "is", "a", "test"})
		if err := app.cmd.Execute(); err != nil {
			sub.Errorf("got error: %v", err)
		}
	})
}
